<template>
  <j-modal
    :title="title"
    :width="width"
    :visible="visible"
    switchFullscreen
    @ok="handleOk"
    :okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
    @cancel="handleCancel"
    cancelText="关闭">
    <tt-question-jira-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></tt-question-jira-form>
  </j-modal>
</template>

<script>

  import TtQuestionJiraForm from './TtQuestionJiraForm'
  export default {
    name: 'TtQuestionJiraModal',
    components: {
      TtQuestionJiraForm
    },
    data () {
      return {
        title: '',
        width: 1200,
        visible: false,
        disableSubmit: false
      }
    },
    methods: {
      add (bmlcid, sfsy) {
        this.visible = true
        this.$nextTick(() => {
          this.$refs.realForm.add(bmlcid, sfsy)
        })
      },
      edit (record, bmlcid) {
        debugger
        this.visible = true
        this.$nextTick(() => {
         // this.$refs.realForm.edit(record, bmlcid)
        this.$refs.realForm.wtfaedit(record, bmlcid)
        })
      },
      close () {
        this.$emit('close')
        this.visible = false
      },
      handleOk () {
        this.$refs.realForm.submitForm()
      },
      submitCallback() {
        this.$emit('close', '2')
        this.$emit('ok')
        this.visible = false
      },
      handleCancel () {
        this.close()
      }
    }
  }
</script>
